package cn.ingrun.ingrunutils.exception;

import cn.ingrun.ingrunutils.responseUtil.ResponseModel;

/**
 * Author ingrun
 * Date 2021/6/9 23:02
 */
public class ResponseException extends Exception {

    private Integer status = 500;
    private String message = "系统错误";

    public ResponseException() {
    }

    public ResponseException(Integer status) {
        this.status = status;
        this.message = String.valueOf(status);
    }

    public ResponseException(String message) {
        this.message = message;
    }

    public ResponseException(Integer status, String message) {
        this.status = status;
        this.message = message;
    }

    public Integer getStatus () {
        return status;
    }

    public void setStatus (Integer status) {
        this.status = status;
    }

    @Override
    public String getMessage () {
        return message;
    }

    public void setMessage (String message) {
        this.message = message;
    }

    public ResponseModel getResponseModel(){
        return new ResponseModel(status, message, null);
    }

}
